﻿@model IEnumerable<HRSM.Models.Notice>

@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/MainLayout.cshtml";
}
<script type="text/javascript">
    $(function () {
        //导航切换
        $(".menuson li.active").removeClass("active");
        $("#noticeItem").addClass("active");
    });
</script>
<div class="place">
    <span>位置：</span>
    <ul class="placeul">
        <li><a href="#">首页</a></li>
        <li><a href="#">公告管理</a></li>
    </ul>
</div>

<div class="rightinfo" style=" border:0px solid red;">
    <div class="tools" style=" border:0px solid green;">
        <ul class="toolbar">
            <li class=""><a href="/Notice/Create"><span><img src="~/images/t01.png" /></span>添加</a></li>
        </ul>
        <ul class="toolbar1">
            <li><span><img src="~/images/t05.png" /></span>设置</li>
        </ul>
        <div style="clear:both"></div>
    </div>
    <table class="tablelist">
        <thead>
            <tr>
                <th>编号<i class="sort"><img src="~/images/px.gif" /></i></th>
                <th>标题</th>
                <th>发布时间</th>
                <th>发布人</th>
                <th>附件</th>
                <th>操作</th>
            </tr>
        </thead>
        <tbody>
            @foreach (var item in Model)
            {
                <tr>
                    <td>
                        @Html.DisplayFor(modelItem => item.ID)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.Title)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.CreateTime)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.Teacher.Name)
                    </td>
                    <td>
                        @if (item.Attachment != null)
                        {
                            <a href="/Home/Down?file=@item.Attachment" class="tablelink">下载</a>
                        }
                    </td>
                    <td>
                        @Html.ActionLink("编辑", "Edit", new { id = item.ID }, new { @class = "tablelink" }) |
                        @Html.ActionLink("查看", "Details", new { id = item.ID }, new { @class = "tablelink" }) |
                        @Html.ActionLink("删除", "Delete", new { id = item.ID }, new { @class = "tablelink" })
                    </td>
                </tr>
            }
        </tbody>
    </table>
</div>
<script type="text/javascript">
    $('.tablelist tbody tr:odd').addClass('odd');
</script>
